<html>
<head>
	<title>test page</title>
	<script type="text/javascript" src="http://yui.yahooapis.com/3.0.0b1/build/yui/yui-min.js"></script>
	<script type="text/javascript" src="../../src/greeting.js"></script>
</head>
<body class=" yui-skin-sam">
	<div id="testLogger"></div>
	<script type="text/javascript">
	
YUI().use('node', 'console', 'test', function(Y) {
	
    var GreetingTest= new Y.Test.Case({
		name: 'GreetingTest',
		
		testShouldGreetInEnglish: function() {
			greeting = new Greeting();
			Y.Assert.areEqual('Hello Dude', greeting.sayHello('English', 'Dude'));
		},
		
		testShouldGreetInFrench: function() {
			translator = Y.Mock();
			Y.Mock.expect(translator, {
				method: 'translate',
				args: ['English', 'French', 'Hello'],
				returns: 'Bonjour'
			});
			greeting = new Greeting(translator);
			Y.Assert.areEqual('Bonjour Madame', greeting.sayHello('French', 'Madame'));
		}
	});	
	
    suite = new Y.Test.Suite('greeting suite');
    suite.add(GreetingTest);
	
    r = new Y.Console({
        verbose : true,
        newestOnTop : false
    });
    r.render('#testLogger');

    Y.Test.Runner.add(suite);
    Y.Test.Runner.run();
});

</script>
</body>
</html>
